package com.touna.regex;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * author: xl
 * time: 2018/6/19 11:55
 * description:正则表达式
 **/
public class RegexGroupTest1 {

    public static void main(String[] args) {
        String regEx = "count(\\d+)(df)";
        String s = "count000dfdfsdffaaaa1";
        Pattern pat = Pattern.compile(regEx);
        Matcher mat = pat.matcher(s);
        if(mat.find()){
            System.out.println(mat.group(0));
            System.out.println(mat.group(1));
            System.out.println(mat.group(2));
        }

    }



}
